package com.bjsxt.service.impl;

import com.bjsxt.mapper.CompanyMapper;
import com.bjsxt.pojo.Company;
import com.bjsxt.pojo.PageA;
import com.bjsxt.service.CompanyService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CompanyServiceimpl implements CompanyService {
    @Autowired
    private CompanyMapper companyMapper;

    //按条件查询公司信息
    @Override
    public PageA<Company> findMore(Integer page, Integer rows, Company company) {

        Page pg = PageHelper.startPage(page, rows);
        List<Company> list = companyMapper.selectMore(company);
        PageA<Company> pga = new PageA<>(list, pg.getTotal());
        return pga;
    }
    //添加公司信息
    @Override
    public Integer insertConpany(Company company) {
        return companyMapper.insertCompany(company);
    }
//修改公司实现
    @Override
    public Integer ChangeCompany(Company company) {
        return companyMapper.changeCompany(company);
    }


}